﻿using System;
using System.Collections.Generic;
using System.Text;

using Intergr8.Data;

namespace Intergr8.Data.StaticPopulationData
{
    public class StaticPopulationDataProvider : DataProvider
    {
        public override System.Data.DataTable Fetch()
        {
            try
            {

                System.Data.DataTable dt = new System.Data.DataTable();
                dt.Columns.Add("B", typeof(System.String)).Caption = "Country Code";
                dt.Columns.Add("C", typeof(System.Double)).Caption = "Population (mil)";
                dt.Columns.Add("D", typeof(System.Double)).Caption = "Area (km2)";
                dt.Rows.Add(new object[] { "CN", 1322970000, 137 });
                dt.Rows.Add(new object[] { "IN", 1130130000, 336 });
                dt.Rows.Add(new object[] { "US", 303605941, 31 });
                dt.Rows.Add(new object[] { "ID", 1904569, 232 });
                dt.Rows.Add(new object[] { "BR", 8514877, 187 });


                return dt;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.TraceError(ex.Message);
                throw new DataProviderException("StaticPopulationDataProvider", "Error generating a DataTable",ex);
            }

        }
    }
}
